package cn.edu.jnu.booklistmainactivity;

import android.os.Bundle;

import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;


public class about_Fragment extends PreferenceFragmentCompat {

    @Override
    public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
        //用了super会报错
        setPreferencesFromResource(R.xml.about_preference, rootKey);

        Preference namePreference = findPreference("about_pref_name");
        assert namePreference != null;
        namePreference.setSummary(BuildConfig.VERSION_NAME + "(" + BuildConfig.VERSION_CODE + ")");

        Preference feedbackPreference = findPreference("about_pref_feedback");
        assert feedbackPreference != null;
        feedbackPreference.setOnPreferenceClickListener(preference -> false);

        Preference licensePreference = findPreference("about_pref_license");
        assert licensePreference != null;
        licensePreference.setOnPreferenceClickListener(preference -> false);

        Preference privacyPolicyPreference = findPreference("about_pref_privacy_policy");
        assert privacyPolicyPreference != null;
        privacyPolicyPreference.setOnPreferenceClickListener(preference -> false);

        Preference termOfServicePreference = findPreference("about_pref_term_of_service");
        assert termOfServicePreference != null;
        termOfServicePreference.setOnPreferenceClickListener(preference -> false);
    }


}
